import instance from '@/utils/request.js'

export function getEmployeesApi(id) {
    return instance({
        url: `/sys/user/${id}`
    })
}
// 保存员工基本信息
export function setEmployeesApi(data) {
    return instance({
        url: `/sys/user/${data.id}`,
        method: 'PUT',
        data
    })
}
export function deleteEmployeesApi(id) {
    return instance({
        url: `/sys/role/${id}`,
        method: 'delete'
    })
}
export function getEmployeesListApi() {
    return instance({
        url: '/sys/user/simple'
    })
}
export function getEmployeesAllListApi(params) {
    return instance({
        url: '/sys/user',
        params
    })
}
export function addEmployeesApi(data) {
    return instance({
        url: 'sys/user',
        method: 'POST',
        data
    })
}
export function importEmployeesApi(data) {
    return instance({
        url: '/sys/user/batch',
        method: 'POST',
        data
    })
}
export function getDetailInfoApi(id) {
    return instance({
        url: `/employees/${id}/personalInfo`
    })
}

export function getJobInfoApi(id) {
    return instance({
        url: `/employees/${id}/jobs`
    })
}

export function setEmployeesRoleApi(data) {
    return instance({
        url: '/sys/user/assignRoles',
        method: 'PUT',
        data
    })
}